我試圖獲取授權碼和令牌來訪問時間序列環境。AADSTS65005:資源無效。 (Azure時間系列洞察API)
我在Azure Active Directory中創建了一個應用程序,並按照link中的說明爲其授予訪問時間序列環境的權限。之後,我得到了我的client_id(應用程序ID),client_secret(應用程序密鑰)和我的租戶ID。
然後我試圖按照此link中的說明進行操作,我試圖在瀏覽器中獲取資源「https://api.timeseries.azure.com/」的驗證代碼。我在我的瀏覽器中插入的地址是這樣的:
https://login.microsoftonline.com/{tenant}/oauth2/authorize?client_id={client_id}&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2F&response_mode=query&resource=https%3A%2F%2Fapi.timeseries.azure.com%2F&state=12345
我三倍檢查值,並在我看來,這一切都是正確的,但我不斷收到在瀏覽器中出現以下錯誤:
AADSTS65005: Invalid resource. The client has requested access to a resource
which is not listed in the requested permissions in the client's application
registration. Client app ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Resource
value from request: https://api.timeseries.azure.com/. Resource app ID:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. List of valid resources from app
registration: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
感謝您的幫助。
只是爲了確保Azure門戶內部,您是否將時間序列資源添加到您的應用程序權限? –
嗨,丹尼爾,謝謝你的迴應。在時間系列環境頁面中,我在數據訪問策略部分添加了註冊的應用程序。 在Azure Active Directory中 - >應用程序註冊 - >時間序列環境 - >設置 - >所需的權限 - >添加API訪問 - >選擇一個API, 我沒有看到任何與時間序列資源相關的API。 –