Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid URI: The format of the URI could not be determined. #35526

Closed
campionite opened this issue Apr 12, 2023 · 5 comments · Fixed by #35627
Closed

Invalid URI: The format of the URI could not be determined. #35526

campionite opened this issue Apr 12, 2023 · 5 comments · Fixed by #35627
Assignees
Labels
ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@campionite
Copy link

Library name and version

Azure.ResourceManager.DataProtectionBackup 1.1.1

Query/Question

The error originates from DataSourceInfo.Serialization.cs(probably on Line#112 -
resourceUri = new Uri(property.Value.GetString());)
Here is the code snippet that throws the exception -
`

           var resourceId = DataProtectionBackupVaultResource.CreateResourceIdentifier(
                            _subscriptionId,
                            _resourceGroupName,
                            _vaultName);
            var resource =
                _armClient.GetDataProtectionBackupVaultResource(resourceId
                    );

            var backupVault = await resource.GetAsync();

            var backupInstancesCollection = backupVault.Value.GetDataProtectionBackupInstances().GetAllAsync();

`

Here is another code snippet that throws the same exception.
`

             var resourceId = DataProtectionBackupInstanceResource.CreateResourceIdentifier(
                            _subscriptionId,
                            _resourceGroupName,
                            _vaultName,
                            _backupInstanceName);
            var resource =
                _armClient.GetDataProtectionBackupInstanceResource(resourceId
                    );
           
            var backupInstance = await resource.GetAsync();

`
Both the snippets provided are trying to get a BackupInstanceResource object

Based on my research, the resourceUri property that gets returned in the REST api call is not a valid Uri. In the Azure portal it shows up like this. Added placeholders to show some confidential Ids.
"resourceUri": "/subscriptions/{subscriptionId}/resourceGroups/myRg/providers/Microsoft.Storage/storageAccounts/samplestorageaccount"

Environment

Microsoft Visual Studio Enterprise 2022 (64-bit) - Current
Version 17.2.5

image

@github-actions github-actions bot added ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-triage This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 12, 2023
@jsquire jsquire added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-team-triage This issue needs the team to triage. labels Apr 12, 2023
@jsquire
Copy link
Member

jsquire commented Apr 12, 2023

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@campionite
Copy link
Author

Please see the stack trace of the exception -
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions) at System.Uri..ctor(String uriString) at Azure.ResourceManager.DataProtectionBackup.Models.DataSourceInfo.DeserializeDataSourceInfo(JsonElement element) at Azure.ResourceManager.DataProtectionBackup.Models.DataProtectionBackupInstanceProperties.DeserializeDataProtectionBackupInstanceProperties(JsonElement element) at Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupInstanceData.DeserializeDataProtectionBackupInstanceData(JsonElement element) at Azure.ResourceManager.DataProtectionBackup.BackupInstancesRestOperations.<GetAsync>d__9.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable 1.ConfiguredTaskAwaiter.GetResult() at Azure.ResourceManager.DataProtectionBackup.DataProtectionBackupInstanceResource.<GetAsync>d__19.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter 1.GetResult() at AzureBlobStorageDemo.Tests.AzureBlobStorageDemoTests.<BackupInstanceNotNull>d__14.MoveNext() in C:\repos\version3\AzureBlobStorageDemo\AzureBlobStorageDemo.Tests\AzureBlobStorageDemoTests.cs:line 181

@HarveyLink
Copy link
Member

Hi @campionite , thank you for the feedback.
We'll apply a hotfix for this issue.

@campionite
Copy link
Author

campionite commented Apr 17, 2023

Thank you for the quick turnaround on this @HarveyLink.
Would you be able to elaborate on the potential solution. Would you be planning to apply a fix on the Azure portal (for resourceUri property) or will the deserialization method will need to be modified in the SDK?

@HarveyLink
Copy link
Member

Azure.ResourceManager.DataProtectionBackup new package released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ARM customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
4 participants