Skip to content

Commit ca58ef4

Browse files
authored
Update location in the operation result if its not present for New-AzManagedApplications (#21640)
* Reset the location header with the async operation URI * Updated the changelog Updated the changelog
1 parent 9fca8ac commit ca58ef4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Resources/ResourceManager/Implementation/ManagedApplications/NewAzureManagedApplication.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ protected override void OnProcessRecord()
119119
odataQuery: null)
120120
.Result;
121121

122+
// Update location in the operation result if its not present. RPaaS does not populate it for us.
123+
operationResult.LocationUri = operationResult.LocationUri ?? operationResult.AzureAsyncOperationUri;
124+
122125
var managementUri = this.GetResourcesClient()
123126
.GetResourceManagementRequestUri(
124127
resourceId: resourceId,

src/Resources/Resources.Test/SessionRecords/Microsoft.Azure.Commands.Resources.Test.ScenarioTests.ManagedApplicationTests/TestManagedApplicationCRUD.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,6 @@
232232
"Pragma": [
233233
"no-cache"
234234
],
235-
"Location": [
236-
"https://management.azure.com/subscriptions/e0f276d3-ee09-4a8b-a527-e2a6ac2ee309/resourceGroups/ps4844/providers/Microsoft.Solutions/locations/EastUS2EUAP/operationStatuses/eyJmdWxseVF1YWxpZmllZEFwcGxpYW5jZUlkIjoiL3N1YnNjcmlwdGlvbnMvZTBmMjc2ZDMtZWUwOS00YThiLWE1MjctZTJhNmFjMmVlMzA5L3Jlc291cmNlR3JvdXBzL3BzNDg0NC9wcm92aWRlcnMvTWljcm9zb2Z0LlNvbHV0aW9ucy9hcHBsaWNhdGlvbnMvcHM4NzA0Iiwiam9iSWQiOiJBcHBsaWFuY2VQcm92aXNpb25pbmdKb2I6MkRSR0E6MkRQUzQ4NDQ6MkRQUzg3MDQifQ?api-version=2017-09-01"
237-
],
238235
"Retry-After": [
239236
"0"
240237
],

src/Resources/Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fixed an issue where location header was missing in the response from the service for New-AzManagedApplication.
2223

2324
## Version 6.6.1
2425
* Added support for Azure resources deployment with parameters file using Bicep parameters syntax

0 commit comments

Comments
 (0)