Open padhibibaswan opened 1 year ago
Added the scope in correct file and it worked .
@padhibibaswan which file did you add the scope ? can you please help ? I have the same scopes that you have in vss-extension.json should we mention the scopes somewhere else ?
never mind, I figured out, we need to add the "scopes": ["vso.work", "vso.code"] based on whether you are dealing with workitems or code/repo and then deploy and test it from test org . thanks for the help @padhibibaswan
We can close this issue.
Code :
import {getClient} from 'azure-devops-extension-api'; import * as SDK from 'azure-devops-extension-sdk'; import {WorkItemTrackingRestClient} from 'azure-devops-extension-api/WorkItemTracking'; import { GitRestClient } from "azure-devops-extension-api/Git/GitClient";
SDK.init().then(() => { SDK.ready().then(async () => {
});
The complete error message that i get is : Access to fetch at 'https://dev.azure.com///_apis/git/Repositories' from origin 'https://bibasample.gallerycdn.vsassets.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I have also added the Scope as below :
"scopes": [ "vso.code_write", "vso.release", "vso.tokens" ]