Azure / Azure/azure-cli

Use az rest with access token

Open
#25,734 1 comment 0 reactions 1 assignee Claimed by @jiasli View on GitHub
Auto-Assign Azure CLI Team customer-reported feature-request rest
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**
`az rest`

**Is your feature request related to a problem? Please describe.**
I want to change the merge strategy of a pull request with `az repos pr update`. But it does not support this. Therefore I wanted to use `az rest` from an azure pipeline, but I have no means of authorizating without an azure subscription.

**Describe the solution you'd like**

I would want to be able to do something like:

`az rest -m patch -b --azure-pat $(System.AccessToken) -u `

**Describe alternatives you've considered**
The following does not work either:

```sh
az rest \
-m patch \
-b '{"completionOptions":{"mergeStrategy":"rebaseMerge"}}' \
-u https://dev.azure.com///apis_/git/repositories/pullrequests/?api-version=7.0 \
--skip-authorization-header \
--headers "Authorization=Bearer $(System.AccessToken)" "Content-Type=application/json"; \
```

and returns

`ERROR: Not Found({"error":{"code":"MissingSubscription","message":"The request did not have a subscription or a valid tenant level resource provider."}})`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.