Giter Site home page Giter Site logo

azure-data-factory-cookbook's Issues

resource_client.resource_groups.create_or_update(dict_storage["rg_name"], rg_params)

AuthorizationFailed) The client '500aefe7-2b09-4721-' with object id '500aefe7-2b09-4721-' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/6b149-4d68-4bc9-ad-``````````/resourcegroups/DataCheck2' or the scope is invalid. If access was recently granted, please refresh your credentials.
Code: AuthorizationFailed
Message: The client '500aefe7-
-4721-8ba0-
*******' with object id '500aefe7--4721-' does not have authorization to perform action 'Microsoft.Resources/subscriptions/resourcegroups/write' over scope '/subscriptions/6b161a49-4d68--a1ad-*******/resourcegroups/DataCheck2' or the scope is invalid. If access was recently granted, please refresh your credentials.

Page 16, Bullet 12: AttributeError: 'CredentialWrapper' object has no attribute 'get_token'

Regarding page 16 of the book, bullet 12, I receive the below error, which appears to be an issue with the Azure API function. Was there a change to the API? Is there a workaround and should the book be updated? I have doublechecked my credentials.


AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_21800/4217901441.py in
1 adf_client = DataFactoryManagementClient(credentials, subscription_id)
2 df_resource = Factory(location='eastus')
----> 3 df = adf_client.factories.create_or_update(rg_name, df_name, df_resource)
4 print_item(df)
5 while df.provisioning_state != 'Succeeded':

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\mgmt\datafactory\operations_factories_operations.py in create_or_update(self, resource_group_name, factory_name, factory, if_match, **kwargs)
305 body_content_kwargs['content'] = body_content
306 request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
--> 307 pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
308 response = pipeline_response.http_response
309

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline_base.py in run(self, request, **kwargs)
209 else _TransportRunner(self._transport)
210 )
--> 211 return first_node.send(pipeline_request) # type: ignore

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 if not _await_result(self._policy.on_exception, request):

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 if not _await_result(self._policy.on_exception, request):

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 if not _await_result(self._policy.on_exception, request):

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 if not _await_result(self._policy.on_exception, request):

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 if not _await_result(self._policy.on_exception, request):

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\mgmt\core\policies_base.py in send(self, request)
45 # type: (PipelineRequest[HTTPRequestType], Any) -> PipelineResponse[HTTPRequestType, HTTPResponseType]
46 http_request = request.http_request
---> 47 response = self.next.send(request)
48 if response.http_response.status_code == 409:
49 rp_name = self._check_rp_not_registered_err(response)

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline\policies_redirect.py in send(self, request)
156 redirect_settings = self.configure_redirects(request.context.options)
157 while retryable:
--> 158 response = self.next.send(request)
159 redirect_location = self.get_redirect_location(response)
160 if redirect_location and redirect_settings['allow']:

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline\policies_retry.py in send(self, request)
443 start_time = time.time()
444 self._configure_timeout(request, absolute_timeout, is_response_error)
--> 445 response = self.next.send(request)
446 if self.is_retry(retry_settings, response):
447 retry_active = self.increment(retry_settings, response=response)

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline\policies_authentication.py in send(self, request)
115 :type request: ~azure.core.pipeline.PipelineRequest
116 """
--> 117 self.on_request(request)
118 try:
119 response = self.next.send(request)

~\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\core\pipeline\policies_authentication.py in on_request(self, request)
92
93 if self._token is None or self._need_new_token:
---> 94 self._token = self._credential.get_token(*self._scopes)
95 self._update_headers(request.http_request.headers, self._token.token)
96

AttributeError: 'CredentialWrapper' object has no attribute 'get_token'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.