Updated Export-AzResourceGroup cmdlet to use the SDK.#13275
Updated Export-AzResourceGroup cmdlet to use the SDK.#13275isra-fel merged 11 commits intoAzure:masterfrom
Conversation
…to xynoclafe/exportTemplateSDK
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
src/Resources/ResourceManager/Implementation/ResourceGroups/ExportAzureResourceGroupCmdlet.cs
Outdated
Show resolved
Hide resolved
src/Resources/ResourceManager/Implementation/ResourceGroups/ExportAzureResourceGroupCmdlet.cs
Outdated
Show resolved
Hide resolved
src/Resources/ResourceManager/Implementation/ResourceGroups/ExportAzureResourceGroupCmdlet.cs
Outdated
Show resolved
Hide resolved
src/Resources/ResourceManager/Implementation/ResourceGroups/ExportAzureResourceGroupCmdlet.cs
Outdated
Show resolved
Hide resolved
| Options = this.GetExportOptions(), | ||
| }; | ||
|
|
||
| var exportedTemplate = ResourceManagerSdkClient.ExportResourceGroup(ResourceGroupName, parameters); |
There was a problem hiding this comment.
Have you had a chance to test export async route? AFAIK, the service side goes into async operation based on the time it takes to export or based on the number of resources (I think it was >= 20 resources). It might be easier to test async route by trying more than 20 resources to export rather than trying to hit the timebound. Do you mind testing this scenario, if you haven't already.
There was a problem hiding this comment.
I don't quite understand the scenario.
There was a problem hiding this comment.
src/Resources/ResourceManager/Implementation/ResourceGroups/ExportAzureResourceGroupCmdlet.cs
Show resolved
Hide resolved
src/Resources/ResourceManager/Implementation/ResourceGroups/ExportAzureResourceGroupCmdlet.cs
Outdated
Show resolved
Hide resolved
…clafe/azure-powershell into xynoclafe/exportTemplateSDK
…to xynoclafe/exportTemplateSDK
isra-fel
left a comment
There was a problem hiding this comment.
I'm good with the implmenetation. Please fix the test erorrs.
…to xynoclafe/exportTemplateSDK
Test errors are fixed and all checks seem to be passing |
| var template = JToken.FromObject(JObject.Parse(resultString)["template"]); | ||
|
|
||
| if (JObject.Parse(resultString)["error"] != null) | ||
| if (this.IsParameterBound(c => c.ApiVersion)) |
There was a problem hiding this comment.
This logic seems like it should be reversed - if we have an apiVersion provided we should go through the Rest API client, otherwise SDK client.
| Options = this.GetExportOptions(), | ||
| }; | ||
| var apiVersion = this.ApiVersion ?? DefaultApiVersion; | ||
| var operationResult = this.GetResourcesClient() |
There was a problem hiding this comment.
You also wouldn't need this line after "this.IsParameterBound(c => c.ApiVersion"
Description
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added