-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error when providing relative path to json file with --settings parameter #11600
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ ahmedelnably, @fabiocav |
@ajklotz can you please try the command with the path as |
Hi, @ahmedelnably - it didn't work:
|
@ajklotz That is weird, I tried it and it did work.
|
Still didn't work. Do we have different versions of Azure CLI or something?
|
I went ahead and updated to azure-cli v2.0.78 and still had the same problem. |
Can you please double check that your json file is correctly formatted? |
Yes, the command succeeds if the json file is in the same directory. Because it succeeds in the same directory, I know that the json file is correctly formatted. |
cc/ @ankitkumarr and @panchagnula for guidance as I ran out of ideas 😑 |
I believe that there is a fundamental problem with the Azure CLI because even if I try to do a similar scenario using ARM templates with |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ ahmedelnably, @fabiocav |
@yonzhan, who from the core cli team help with this? |
@ahmedelnably If the CLI commands are contributed by service team and CLI team currently does not take over, we will mark the Service Attention label. Do you think it is not the case? |
I wish I knew why it worked for ahmedelnably. Any update on this? |
@ahmedelnably You mentioned that this worked for you. Did you try this in PowerShell or in Bash? If you tried in Bash, can you try in PowerShell? |
On Windows, relative path shouldn't start with This can be verified with: >python
>>> import codecs
>>> codecs.open("\\temp\\foo.json")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\{}\AppData\Local\Programs\Python\Python38\lib\codecs.py", line 905, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: '\\temp\\foo.json'
>>> codecs.open("temp\\foo.json")
<_io.TextIOWrapper name='temp\\foo.json' mode='r' encoding='cp65001'> |
@jiasli That was it, you solved my problem. Thank you so much. |
@ajklotz I still have this issue only when I use the Azure CLI task from Azure devOps pipeline on its windows agent (azure-cli 2.5.0 *), though I can run this same on my local, mysettings.json in the source dir only. Have same error even after explicitly specifying the path "@$(Build.SourcesDirectory)\mysettings.json"
|
@asishr14 - Hopefully you have already solved it but I was in similar situation. In YAML pipelines, you can specify the working directory and so the path is not required at all. In the below example the JSON file XYZ.json exists in this location in the GIT repository - $(System.DefaultWorkingDirectory)/A/B/C
|
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az functionapp config appsettings set
Errors:
To Reproduce:
Create a powershell script that executes the command below. The script and settingsFile are in different folders. So a relative path is provided to the $settingsFile.
az functionapp config appsettings set --name $functionAppName --resource-group $resourceGroupName --settings $settingsFile --slot $slot
The powershell script accepts 4 parameters
The powershell script is executed like this:
.\functionAppSettings.ps1 -functionAppName wbqueueprocessing -resourceGroupName WB-CI -settingsFile "\Stage\QueueProcessing\@queueProcessingAppSettings-CI.json" -slot stage
Expected Behavior
Azure CLI updates application settings in Azure for the function app
Environment Summary
Additional Context
Just to provide some context to the problem here...I created an Azure CLI script to deploy function apps to 5 different environments that have a production/stage slot. So my repository is structured in a way to make it easy to find these json settings files in their appropriate folder instead of having the script and 20 json files in one folder.
The text was updated successfully, but these errors were encountered: