File tree Expand file tree Collapse file tree 4 files changed +30
-30
lines changed
src/ResourceManager/DataFactories/Commands.DataFactories/Models Expand file tree Collapse file tree 4 files changed +30
-30
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ public virtual PSHub CreatePSHub(CreatePSHubParameters parameters)
66
66
parameters . Name ,
67
67
parameters . RawJsonContent ) )
68
68
{ DataFactoryName = parameters . DataFactoryName , ResourceGroupName = parameters . ResourceGroupName } ;
69
+
70
+ if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( hub . ProvisioningState ) )
71
+ {
72
+ // ToDo: service side should set the error message for provisioning failures.
73
+ throw new ProvisioningFailedException ( Resources . HubProvisioningFailed ) ;
74
+ }
69
75
} ;
70
76
71
77
if ( parameters . Force )
@@ -95,12 +101,6 @@ public virtual PSHub CreatePSHub(CreatePSHubParameters parameters)
95
101
createHub ) ;
96
102
}
97
103
98
- if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( hub . ProvisioningState ) )
99
- {
100
- // ToDo: service side should set the error message for provisioning failures.
101
- throw new ProvisioningFailedException ( Resources . HubProvisioningFailed ) ;
102
- }
103
-
104
104
return hub ;
105
105
}
106
106
Original file line number Diff line number Diff line change @@ -135,6 +135,14 @@ public virtual PSLinkedService CreatePSLinkedService(CreatePSLinkedServiceParame
135
135
ResourceGroupName = parameters . ResourceGroupName ,
136
136
DataFactoryName = parameters . DataFactoryName
137
137
} ;
138
+
139
+ if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( linkedService . ProvisioningState ) )
140
+ {
141
+ string errorMessage = linkedService . Properties == null
142
+ ? string . Empty
143
+ : linkedService . Properties . ErrorMessage ;
144
+ throw new ProvisioningFailedException ( errorMessage ) ;
145
+ }
138
146
} ;
139
147
140
148
if ( parameters . Force )
@@ -163,14 +171,6 @@ public virtual PSLinkedService CreatePSLinkedService(CreatePSLinkedServiceParame
163
171
createLinkedService ) ;
164
172
}
165
173
166
- if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( linkedService . ProvisioningState ) )
167
- {
168
- string errorMessage = linkedService . Properties == null
169
- ? string . Empty
170
- : linkedService . Properties . ErrorMessage ;
171
- throw new ProvisioningFailedException ( errorMessage ) ;
172
- }
173
-
174
174
return linkedService ;
175
175
}
176
176
Original file line number Diff line number Diff line change @@ -197,6 +197,14 @@ public virtual PSPipeline CreatePSPipeline(CreatePSPipelineParameters parameters
197
197
ResourceGroupName = parameters . ResourceGroupName ,
198
198
DataFactoryName = parameters . DataFactoryName
199
199
} ;
200
+
201
+ if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( pipeline . ProvisioningState ) )
202
+ {
203
+ string errorMessage = pipeline . Properties == null
204
+ ? string . Empty
205
+ : pipeline . Properties . ErrorMessage ;
206
+ throw new ProvisioningFailedException ( errorMessage ) ;
207
+ }
200
208
} ;
201
209
202
210
if ( parameters . Force )
@@ -225,14 +233,6 @@ public virtual PSPipeline CreatePSPipeline(CreatePSPipelineParameters parameters
225
233
createPipeline ) ;
226
234
}
227
235
228
- if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( pipeline . ProvisioningState ) )
229
- {
230
- string errorMessage = pipeline . Properties == null
231
- ? string . Empty
232
- : pipeline . Properties . ErrorMessage ;
233
- throw new ProvisioningFailedException ( errorMessage ) ;
234
- }
235
-
236
236
return pipeline ;
237
237
}
238
238
Original file line number Diff line number Diff line change @@ -130,6 +130,14 @@ public virtual PSTable CreatePSTable(CreatePSTableParameters parameters)
130
130
ResourceGroupName = parameters . ResourceGroupName ,
131
131
DataFactoryName = parameters . DataFactoryName
132
132
} ;
133
+
134
+ if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( table . ProvisioningState ) )
135
+ {
136
+ string errorMessage = table . Properties == null
137
+ ? string . Empty
138
+ : table . Properties . ErrorMessage ;
139
+ throw new ProvisioningFailedException ( errorMessage ) ;
140
+ }
133
141
} ;
134
142
135
143
if ( parameters . Force )
@@ -158,14 +166,6 @@ public virtual PSTable CreatePSTable(CreatePSTableParameters parameters)
158
166
createTable ) ;
159
167
}
160
168
161
- if ( ! DataFactoryCommonUtilities . IsSucceededProvisioningState ( table . ProvisioningState ) )
162
- {
163
- string errorMessage = table . Properties == null
164
- ? string . Empty
165
- : table . Properties . ErrorMessage ;
166
- throw new ProvisioningFailedException ( errorMessage ) ;
167
- }
168
-
169
169
return table ;
170
170
}
171
171
You can’t perform that action at this time.
0 commit comments